import { myRequest } from "../utils/request.js"
// const baseUrl = `http://1.92.66.174:8091`;
 const baseUrl = `https://www.wuxiankj.com`;
const appid = 'wxb132f97a4e52cdc4';

// 微信登录
export function login(code){
	return myRequest(baseUrl+`/wx/user/login?code=${code}`,'GET',null,false);
}
// 获取用户信息
export function getUserInfo(){
	return myRequest(baseUrl+`/wx/user/userinfo`,'GET',null,);
}

export function upDateUserInfo(data){
	return myRequest(baseUrl+`/wx/user/update`,'POST',data,);
}

// 获取设备list
export function getAdviceList(){
	return myRequest(baseUrl+`/api/device/list/query`,'GET');
}

/**
 * 添加设备  
 * @param code
*/
export function addAdvice(data){
	
	return myRequest(baseUrl+`/api/device/add`,'POST',data);
}
/**
 * 
*/
export function updateAdviceList(){
	return myRequest(baseUrl+`/api/device/${appid}/update`,'GET',null,);
}

// 消费记录
export function quaryorderList(){
	return myRequest(baseUrl+`/wx/order/quaryorder`,'GET');
}
//套餐list 
export function comboquary(){
	return myRequest(baseUrl + `/wx/combo/quary`,'GET')
}


export const uplodUrl = baseUrl + `/wx/media/v1/upload`;
export function upload(){
	return myRequest(baseUrl + `/wx/media/v1/upload`,'POST')
}

// 购买套餐
export function addOrder(){
	return myRequest(baseUrl + `/wx/order/add`,'POST')
}
 // 套餐list
export function orderList(){
	return myRequest(baseUrl + `/wx/combo/query`,'GET')
}

 // 设备详情
export function adviceConfig(){
	return myRequest(baseUrl + `/api/device/config/query`,'GET')
}

export function updateAdvice(data){
	return myRequest(baseUrl + `/api/device/v2/update`,'POST',data)
}

// 查询设备视频
export function quaryvideo(data){
	return myRequest(baseUrl + `/wx/device/quaryvideo`,'GET',data)
}
// 查询设备图片
export function quarypic(data){
	return myRequest(baseUrl + `/wx/device/quarypic`,'GET',data)
}

// 提交模式
export function talktype(data){
	return myRequest(baseUrl + `/wx/device/update/talktype`,'POST',data)
}

// 提交图片
export function addpic(data){
	return myRequest(baseUrl + `/wx/device/addpic`,'POST',data)
}
// 提交视频
export function addvideo(data){
	return myRequest(baseUrl + `/wx/device/addvideo`,'POST',data)
}

//创建订单
export function createOrder(data){
	return myRequest(baseUrl + `/wx/api/payment/user/createOrder`,'POST',data)
}

// 获取打卡记录列表
export function friendList(data){
	return myRequest(baseUrl + `/api/tickoff/friend/list`,'POST',data)
}
//查询打卡记录详情
export function friendRecord(data){
	return myRequest(baseUrl + `/api/tickoff/friend/record`,'POST',data)
}














